const posts = [
    {
        title: '如何学习前端开发',
        date: '2024-06-01',
        summary: '分享一些学习前端开发的经验和常用资源。',
    },
    {
        title: '我的旅行日记',
        date: '2024-05-20',
        summary: '记录一次难忘的旅行经历和美丽风景。',
    },
    {
        title: '高效时间管理技巧',
        date: '2024-05-10',
        summary: '介绍几种实用的时间管理方法，提升工作效率。',
    },
];

const postList = document.getElementById('post-list');

posts.forEach(post => {
    const postDiv = document.createElement('div');
    postDiv.className = 'post';

    const title = document.createElement('div');
    title.className = 'post-title';
    title.textContent = post.title;

    const date = document.createElement('div');
    date.className = 'post-date';
    date.textContent = post.date;

    const summary = document.createElement('div');
    summary.className = 'post-summary';
    summary.textContent = post.summary;

    postDiv.appendChild(title);
    postDiv.appendChild(date);
    postDiv.appendChild(summary);

    postList.appendChild(postDiv);
}); 